package cn.wolfcode.trip.base.domain;

import cn.wolfcode.trip.base.util.JSONUtil;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;

@Setter
@Getter
@ToString
public class LandmarkDetai {
    public static final long hasDiscount=1;   //有折扣
    public static final long noDiscount=0;    //没折扣

    private Long id;

    private String title;

    private String coverURL;

    private Long grade;

    private BigDecimal childPrice;

    private Long adultPrice;

    private String location;

    private Long lcdId;

    private Long discount;   //折扣

    private LandmarkContent landmarkContent; //景点内容


    public String getDiscountDispaly(){
        if(discount==null){
            return "";
        }else if(discount==hasDiscount){
            return "推荐头条";
        }else{
            return "普通门票";
        }
    }

    public String getJsonString(){
        Map<String,Object> map=new HashMap<>();
        map.put("id",id);
        map.put("title",title);
        map.put("coverURL",coverURL);
        map.put("grade",grade);
        map.put("childPrice",childPrice);
        map.put("adultPrice",adultPrice);
        map.put("location",location);
        map.put("childPrice",childPrice);
        map.put("lcdId",lcdId);
        map.put("discount",discount);
        return JSONUtil.toJSONString(map);
    }

}